<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var num=[[1,2,3],[4,5,6],[7,8,9]];
    var nu=[];
    for(var i=0;i<num[0].length;i++){
        nu[i]=[];
        for (var j=0;j<num.length;j++){
            nu[i][j]=num[j][i];
        }
    }
    console.log(nu);
</script>
</body>
</html>